import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/callback',
    name: 'about',
    component: () => import(/* webpackChunkName: "about" */ '../views/CallBackView.vue')
  },
  {
    path: '/goodsList',
    name: 'GoodsView',
    component: () => import(/* webpackChunkName: "about" */ '../views/GoodsView.vue')
  },
  {
    path: '/cartList',
    name: 'CartView',
    component: () => import(/* webpackChunkName: "about" */ '../views/CartView.vue')
  },
  {
    path: '/caipin',
    name: 'CaiPin',
    component: () => import(/* webpackChunkName: "about" */ '../views/CaiPinView.vue'),
    children:[
      {
        path: '/zhushi',
        name: 'ZhushiView',
        component: () => import(/* webpackChunkName: "about" */ '../views/ZhushiView.vue')
      },
      {
        path: '/tianpin',
        name: 'TianpinView',
        component: () => import(/* webpackChunkName: "about" */ '../views/TianpinView.vue')
      },
      {
        path: '/zaocan',
        name: 'ZaocanView',
        component: () => import(/* webpackChunkName: "about" */ '../views/ZaocanView.vue')
      }
    ]
  },
  {
    path: '/categoryList',
    name: 'CategoryList',
    component: () => import(/* webpackChunkName: "about" */ '../views/CategoryList.vue')
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
